extends Node2D

signal life_num_change_signal
signal game_over_signal
var play_level_num=0
var _life_num=3 setget set_life_num,get_life_num
func set_life_num(life_num):
	_life_num=life_num
	emit_signal("life_num_change_signal",_life_num)
	if life_num<=0:
		game_over()
func get_life_num():
	return _life_num

func _ready():
	yield(get_tree(),"idle_frame")
	emit_signal("life_num_change_signal",_life_num)

var is_over=false
func game_over():
	if is_over: return
	is_over=true
	emit_signal("game_over_signal")
	yield(get_tree().create_timer(2.5),"timeout")
	is_over=false
	set_life_num(3)
	play_level_num=0
	var _e=get_tree().change_scene("res://Levels/Level01.tscn")

